//
//  GWChannelsGroupModel.m
//  GiftWanted
//
//  Created by lanou on 15/11/10.
//  Copyright © 2015年 陈文杰. All rights reserved.
//

#import "GWChannelsGroupModel.h"
#import "GWChannelsModel.h"

@implementation GWChannelsGroupModel
- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"id"]) {
        _id_s = value;
    }
}

- (instancetype)init {
    self = [super init];
    if (self) {
        _channels = [NSMutableArray arrayWithCapacity:0];
    }
    return self;
}

- (void)setValue:(id)value forKey:(NSString *)key {
    if ([key isEqualToString:@"channels"]) {
        for (NSDictionary *dict in value) {
            GWChannelsModel *model = [[GWChannelsModel alloc] init];
            [model setValuesForKeysWithDictionary:dict];
            [_channels addObject:model];
        }
    } else {
        [super setValue:value forKey:key];
    }
    
}
@end
